<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var a = 10
        var test = function (aa) {
            aa = 20
            console.log(aa)
        }
        test(a)
        console.log(a)

        var a = [1, 2, 3]
        var test = function (a) {
            a = [4]
            console.log(a)
        }
        test(a)
        console.log(a)

        var a = [1, 2, 3]
        var test = function (a) {
            a.push(6)
            console.log(a)
        }
        test(a)
        console.log(a)
    </script>
</body>

</html>